<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        .box {
            border: 1px solid black;
            margin: 10px;
            display: flex;
            flex-direction: row;
        }
        .box2 {
            flex-direction: row-reverse;
        }
        .box3 {
            flex-direction: column;
        }
        .box4 {
            flex-direction: column-reverse;
        }
        .block {
            background-color: red;
            height: 100px;
            width: 100px;
            margin: 10px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="block">1</div>
        <div class="block">2</div>
        <div class="block">3</div>
    </div>
    <div class="box box2">
        <div class="block">1</div>
        <div class="block">2</div>
        <div class="block">3</div>
    </div>
    <div class="box box3">
        <div class="block">1</div>
        <div class="block">2</div>
        <div class="block">3</div>
    </div>
    <div class="box box4">
        <div class="block">1</div>
        <div class="block">2</div>
        <div class="block">3</div>
    </div>
</body>
</html>